#!/usr/bin/env python
#上三角
def foo(x):
    for i in range(1,x+1):
        for j in range(x,0,-1):
            if j>i:
                print(' ',end='\t')
            else:
                print(j,end='\t')
        print('\n')
foo(12)

print('~~~~'*30)
#下三角
def lls(x):
    for i in range(x,0,-1):
        for j in range(x,0,-1):
            if j>i:
                print(' ',end='\t')
            else:
                print(j,end='\t')
        print('\n')
lls(12)

# 试试不用\t保证空隔宽度一致



